drop table customer;
create table customer(id number(6) not null primary key, cname varchar2(20) not null unique, sal number(8,2), sex char(1), birth date);
create table customer_fav(id number(6) not null primary key, cid number(6) not null, fid number(6) not null);
create table fav(id number(6) not null primary key, fname varchar2(20) not null);
alter table customer_fav add constraint FK_CID foreign key(cid) references customer(id);
alter table customer_fav add constraint FK_FID foreign key(fid) references fav(id);

drop sequence cid_seq;
drop sequence cfid_seq;
drop sequence fid_seq;
create sequence cid_seq start with 1 increment by 1;
create sequence cfid_seq start with 1 increment by 1;
create sequence fid_seq start with 1 increment by 1;

insert into fav(id,fname) values(fid_seq.nextval, 'basketball');
insert into fav(id,fname) values(fid_seq.nextval, 'football');
select * from customer;
select * from customer_fav;
select * from fav;
delete customer;
delete customer_fav;
